<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="vue.js"></script>
</head>
<body>
    <div id="app">
        <cpn></cpn>
    </div>
    <template id="cpn">
        <div v-show="isShow">
            <h2>我是组件</h2>
            <p>123</p>
        </div>
    </template>
    <script>
    const app = new Vue({
        el: '#app',
        data: {
            isShow: true
        },
        methods: {},
        components: {
            cpn: {
                template: '#cpn',
                data() {
                    return {
                        isShow: false
                    }
                }
            }
            
            
        }
    })
    </script>
</body>
</html>